package com.rose.springbootmoredatasourcemybatis.service.impl;



import com.rose.springbootmoredatasourcemybatis.annotation.DataSource;
import com.rose.springbootmoredatasourcemybatis.entity.User;
import com.rose.springbootmoredatasourcemybatis.mapper.UserMapper;
import com.rose.springbootmoredatasourcemybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    public User Sel(int id) {
        return userMapper.Sel(id);
    }
    @DataSource("slave1")  //slave1
    public User Sel1(int id) {
        return userMapper.Sel(id);
    }
    @DataSource("slave2")  //slave2
    public User Sel2(int id) {
        return userMapper.Sel(id);
    }
}
